package org.hyOnline.ebay
{
	import flash.external.ExternalInterface;


	public class JsForHfash
	{
		public static const JsIsReady:String = 'e$.is_ready',
			JsPrintLn:String = 'e$.println',
			JsHasInterface:String='e$.hasInterface',
			JsGetProductId:String='e$.getProductId',
			JsGetProductType:String='e$.getProductType',
			JsFeedJSON:String='e$.feedJSON',
			JsSetupPage:String = 'e$.setupPage';
		public static const url:String='window.location.href.toString';
		public function JsForHfash()
		{
			//this is from notebook.
		}
		public static function is_Ready():Boolean{
			var res:* =ExternalInterface.call(JsIsReady) ;
			if(res == null || typeof res !='boolean'){
				return false
			}else{
				return res;
			}
		}
		public static function hasInterface(name:String):Boolean{
			return ExternalInterface.call(JsHasInterface,name);
		}
		public static function println(value:String=""):void{
			ExternalInterface.call(JsPrintLn,value);
		}
		public static function getProductId():String{
			return ExternalInterface.call(JsGetProductId);
		}
		public static function getProductType():String{
			return ExternalInterface.call(JsGetProductType);
		}
		public static function feedJSON(jSon:Object):Boolean{
			return ExternalInterface.call(JsFeedJSON,jSon);
		}
		public static function setupPage():void{
			ExternalInterface.call(JsSetupPage);
		}
		public static function getURL():String{
			return ExternalInterface.call(url);
		}
	}
}